/**
 * 路由配置文件
 */
import mainRoute from '../deps/routes/main'

export default function () {
  return [{
    permission: 'all',
    route: {
      path: `/designIndex`,
      name: 'designIndex',
      meta: {
        title: '网络设计',
        webmoduleId: 60,
        breadcrumb: true
      },
      component: () => import(`../pages/home/index`)
    }
  }, {
    permission: 'all',
    route: {
      path: `/test1`,
      name: 'test1',
      meta: {
        title: 'test1',
        breadcrumb: false  // 测试页面不需要显示在面包屑中
      },
      component: () => import(`../pages/nil/index`)
    }
  }, {
    permission: 'all',
    route: {
      path: `/test2`,
      name: 'test2',
      meta: {
        title: 'test2',
        breadcrumb: false  // 测试页面不需要显示在面包屑中
      },
      component: () => import(`../pages/nil/index`)
    }
  }, {
    permission: 'all',
    route: {
      path: `/test`,
      name: 'test',
      meta: {
        title: 'test',
        breadcrumb: true  // 测试页面不需要显示在面包屑中
      },
      component: () => import(`../pages/nil/index`)
    }
  }, {
    permission: 'all',
    route: {
      path: '/weldbox',
      name: 'weldbox',
      meta: {
        title: '熔接管理',
        webmoduleId: 61,
        breadcrumb: true
      },
      component: () => import('../pages/weldbox/index.vue')
    }
  }].concat(mainRoute.map(i => {
    return {
      permission: 'all',
      route: {
        path: `/${i.realUrl || i.url}`,
        name: i.realUrl || i.url,
        meta: {
          title: i.name,
          breadcrumb: i.breadcrumb  // 主路由需要显示在面包屑中
        },
        component: () => import(`../pages/${i.parent}/index`)
      }
    }
  }))
}
